package com.test.langchain4j.controller;

import com.test.langchain4j.service.ChatAssistant;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 *
 * @description:
 * @author: liuziyang
 * @since: 2025/7/30 14:24
 * @modifiedBy:
 * @version: 1.0
 */
@RestController
public class DeclarativeAIServiceController {
  @Resource private ChatAssistant chatAssistant;

  @GetMapping(value = "/lc4j/boot/declarative")
  public String declarativeChat(
      @RequestParam(value = "prompt", defaultValue = "你是谁") String prompt) {
    return chatAssistant.chat(prompt);
  }
}
